a11y: Document GtkRevealer's accessible state
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 12 Nov 2020 16:19:14 +0000 (16:19 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 12 Nov 2020 21:46:06 +0000 (21:46 +0000)
Use the GROUP role, and make sure to note that the child is always
revealed. Unlike GtkExpander, GtkRevealer can only be programmatically
toggled, so we cannot turn it into a "button" object.

gtk/gtkrevealer.c

index 716228954c1366c4896ebff22204512f50960be6..f0627d456be613f7958010f888e3a29654a4a9d0 100644 (file)
  * When styling #GtkRevealer using CSS, remember that it only hides its contents,
  * not itself. That means applied margin, padding and borders will be
  * visible even when the #GtkRevealer:reveal-child property is set to %FALSE.
+ *
+ * # Accessibility
+ *
+ * GtkRevealer uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
+ *
+ * The child of GtkRevealer, if set, is always available in the accessibility
+ * tree, regardless of the state of the revealer widget.
  */
 
 /**
@@ -346,6 +353,7 @@ gtk_revealer_class_init (GtkRevealerClass *klass)
   g_object_class_install_properties (object_class, LAST_PROP, props);
 
   gtk_widget_class_set_css_name (widget_class, I_("revealer"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GROUP);
 }
 
 /**